import request from "@/utils/request"

import type { UserState, UserModel } from "@/api/acl/model/userModel"
enum Api {
  getUserList = "/admin/acl/user",
  deleteUser = "/admin/acl/user/remove",
  addUser = "/admin/acl/user/save",
  UpdateUser = "/admin/acl/user/update",
}

// 获取数据
export const reqGetUserList = (page: number, limit: number) => {
  return request.get(Api.getUserList + `/${page}/${limit}`)
}

// 删除
export const reqDeleteUserOne = (id: number) => {
  return request.delete<any, any>(Api.deleteUser + `/${id}`)
}

// 添加数据
export const reqGetAddUser = (user: UserModel) => {
  return request.post<any, null>(Api.addUser, user)
}

// 修改数据
export const reqUpdateUser = (user: UserModel) => {
  return request.put<any, null>(Api.UpdateUser, user)
}
